import { observable, action } from "mobx";
import GxlTableSheet from '../components/GxlTable/Sheet';
class SheetStore {
    @observable sheets = [new GxlTableSheet('untitled')];
    @observable currentSheetIndex = 0;
    @observable currentSheetData = undefined;
    @observable selectedRects = []
    @action setSelectedRects(rects) {
        this.selectedRects = rects
    }
    @action getCurrentSheet() {
        if (!this.currentSheetData) {
            this.currentSheetData = this.sheets[this.currentSheetIndex]
        }
        return this.currentSheetData;
    }
    @action switchSheetTo(sheetIndex) {
        const toSheet = this.sheets[sheetIndex]
        if (toSheet) {
            this.currentSheetData = toSheet;
            this.currentSheetIndex = sheetIndex;
        }
    }
}
export default SheetStore;